#ifndef _BPMDetection_H_
#define _BPMDetection_H_

#include <fmod.h>
#include <string.h>
#include <bpm_detect.h>

FMOD_RESULT F_CALLBACK dspCallback(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels);

class BPMDetection {
    private:

    void * bpm_detection;

    public:

    BPMDetection() {
        this->bpm_detection = BPM_Create();
        FMOD_DSP_DESCRIPTION dspDesc;
        memset(&dspDesc, 0, sizeof(dspDesc));
        strcpy(dspDesc.name, "BPM Detection DSP\0");
        dspDesc.read = dspCallback;
        dspDesc.channels = 0;
        dspDesc.userdata = this->bpm_detection;
    }

    void * getBpmDetection() {
        return this->bpm_detection;
    }
};

#endif
